package com.yinhe.system.service.impl;

import java.util.List;
import com.yinhe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yinhe.system.mapper.SysApplicationsMapper;
import com.yinhe.system.domain.SysApplications;
import com.yinhe.system.service.ISysApplicationsService;

/**
 * 应用权限Service业务层处理
 * 
 * @author yinhe
 * @date 2022-07-21
 */
@Service
public class SysApplicationsServiceImpl implements ISysApplicationsService 
{
    @Autowired
    private SysApplicationsMapper sysApplicationsMapper;

    /**
     * 查询应用权限
     * 
     * @param menuId 应用权限主键
     * @return 应用权限
     */
    @Override
    public SysApplications selectSysApplicationsByMenuId(Long menuId)
    {
        return sysApplicationsMapper.selectSysApplicationsByMenuId(menuId);
    }

    /**
     * 查询应用权限列表
     * 
     * @param sysApplications 应用权限
     * @return 应用权限
     */
    @Override
    public List<SysApplications> selectSysApplicationsList(SysApplications sysApplications)
    {
        return sysApplicationsMapper.selectSysApplicationsList(sysApplications);
    }

    /**
     * 新增应用权限
     * 
     * @param sysApplications 应用权限
     * @return 结果
     */
    @Override
    public int insertSysApplications(SysApplications sysApplications)
    {
        sysApplications.setCreateTime(DateUtils.getNowDate());
        return sysApplicationsMapper.insertSysApplications(sysApplications);
    }

    /**
     * 修改应用权限
     * 
     * @param sysApplications 应用权限
     * @return 结果
     */
    @Override
    public int updateSysApplications(SysApplications sysApplications)
    {
        sysApplications.setUpdateTime(DateUtils.getNowDate());
        return sysApplicationsMapper.updateSysApplications(sysApplications);
    }

    /**
     * 批量删除应用权限
     * 
     * @param menuIds 需要删除的应用权限主键
     * @return 结果
     */
    @Override
    public int deleteSysApplicationsByMenuIds(Long[] menuIds)
    {
        return sysApplicationsMapper.deleteSysApplicationsByMenuIds(menuIds);
    }

    /**
     * 删除应用权限信息
     * 
     * @param menuId 应用权限主键
     * @return 结果
     */
    @Override
    public int deleteSysApplicationsByMenuId(Long menuId)
    {
        return sysApplicationsMapper.deleteSysApplicationsByMenuId(menuId);
    }
}
